<template>
	<div>
		<div class="mb20 mt20">
			<span class="index_num success_bg">2</span>
			<b class="f14">工作文件</b>
		</div>
		<table class="owntable mb20 table1" border="0" cellspacing="0" cellpadding="1" style="width: 100%;" v-if="detail.guifanFileList && detail.guifanFileList.length != 0">
			<tr><td style="">规范性操作文件</td></tr>
			<tr v-for="(item, i) in detail.guifanFileList" :key="i">
				<td class="white_bg">
					<div class="flex_between">
						<span class="main_co pointer" @click="preContent(item, 4)">{{ item.name }}</span>
						<div class="gray_f">
							<!-- 2021-11-01 15:29 编辑 -->
							<!-- <el-button size="mini" v-if="detail.isSystemCover == '1'">封面预览</el-button> -->
							<el-button size="mini" @click="pre(item)" v-if="item.templateCover">封面预览</el-button>
							<!-- <el-checkbox class="ml10" v-model="check"></el-checkbox> -->
						</div>
					</div>
				</td>
			</tr>
		</table>

		<table class="owntable mb20 table1 " border="0" cellspacing="0" cellpadding="1" style="width: 100%;">
			<tr>
				<td width="150">记录保留期限</td>
				<td class="white_bg">{{ detail.retentionPeriod }}年</td>
			</tr>
		</table>

		<table class="owntable table1 tableLayout" border="0" cellspacing="0" cellpadding="0" style="width: 100%;">
			<tr>
				<td>记录</td>
				<td class="gray_bg" width="200">记录流水编号/记录哈希值</td>
			</tr>
		</table>

		<table class="owntable table1 tableLayout" border="0" cellspacing="0" cellpadding="0" style="width: 100%;" v-for="(item, i) in detail.jiluFileList" :key="i">
			<tr>
				<th rowspan="2" class="white_bg">
					<div class="flex_between">
						<span class="main_co pointer" @click="preContent(item, 3)">{{ item.name }}</span>
						<div><el-button size="mini" @click="pre(item)" v-if="item.isSystemCover==1">封面预览</el-button></div>
					</div>
				</th>
				<td width="200" class="overell white_bg">{{ item.serialNumber }}</td>
			</tr>
			<tr>
				<td width="200" class="overell white_bg">
					<el-tooltip effect="light" :content="item.hashValue" placement="top-start" v-if="item.hashValue">
						<div class="cell overell pointer main_co" @click="onCopy(item.hashValue)">{{ item.hashValue }}</div>
					</el-tooltip>
					<span v-else>-</span>
				</td>
			</tr>
		</table>

		<pdf :pdfUrl="src" ref="pdf"></pdf>
	</div>
</template>

<script>
import pdf from '../pdf/index.vue';
export default {
	components: {
		pdf
	},
	props: {
		detail: {
			type: Object,
			default() {
				return {};
			}
		}
	},
	data() {
		return {
			src: ''
		};
	},
	methods: {
		pre(item) {
			if (item.templateCover) {
				this.src = item.templateCover;
				this.$refs.pdf.open();
			}
		}
	}
};
</script>

<style></style>
